#include "CategoryBlock.h"
#include "EntryBlock.h"
#include <QXmlStreamWriter>

CategoryBlock::~CategoryBlock()
{
	QHashIterator<int, EntryBlock*> it(_entries);
	while (it.hasNext()) {
		it.next();
		delete it.value();
	}
}

void CategoryBlock::dump(QXmlStreamWriter& writer)
{
	writer.writeStartElement("ul");
	writer.writeAttribute("class", "list");
	for (int i=0; i<_entries.size(); ++i) {
		_entries.value(i)->dump(writer);
	}
	writer.writeEndElement(); // ul
}

